/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AdicaoComponenteDep.java
 *
 * Created on 24/09/2009, 23:46:11
 */

package front.end.subestacao.ui;

import java.util.LinkedList;
import java.util.List;

import javax.swing.JDialog;
import javax.swing.JOptionPane;

import org.jdesktop.application.Action;
import org.jdesktop.swingbinding.JComboBoxBinding;

import front.end.subestacao.itens.Componente;
import front.end.subestacao.itens.Painel;
import front.end.subestacao.nucleo.ModSubEstFacade;

/**
 * 
 * @author Wilson_2
 */
public class AdicaoComponenteDep extends javax.swing.JDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Componente componente;
	private Painel painel;
	private ModSubEstFacade modSubEstacao;
	List<Componente> comps1 = new LinkedList<Componente>();
	List<Componente> comps2 = new LinkedList<Componente>();
	List<Componente> comps3 = new LinkedList<Componente>();
	
	

	private String tipoDependencia1;
	private String tipoDependencia2;
	private String tipoDependencia3;

	

	@SuppressWarnings("unchecked")
	private JComboBoxBinding jComb1;
	
	@SuppressWarnings("unchecked")
	private JComboBoxBinding jComb2;
	
	@SuppressWarnings("unchecked")
	private JComboBoxBinding jComb3;

	/** Creates new form AdicaoComponenteDep */
	public AdicaoComponenteDep(String titulo, ModSubEstFacade modSubEstacao,
			Componente componente, Painel painel, JDialog moldalAnterior, Boolean moldal) {

		super(FrontEndSubApp.getApplication().getMainFrame());
		
		this.setTitle(titulo);
		this.componente = componente;
		this.painel = painel;
		this.modSubEstacao = modSubEstacao;
		
		

		initComponents();
		
		setModal(true);
		
		this.labelInfo2.setText("do Componente " + componente.getNome());

		if (!componente.getDependencias().isEmpty()) {
			if (componente.getDependencias().size() == 1 ) {

				painelDep2.setVisible(false);
				painelDep3.setVisible(false);
                
				
				tipoDependencia1 = componente.getDependencias().get(0);
				
					
				
				

				comps1 = painel.getComponentesPorTipo(tipoDependencia1);
				txtDep1.setText(tipoDependencia1);
				jComb1 = org.jdesktop.swingbinding.SwingBindings
						.createJComboBoxBinding(
								org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
								comps1, lstDep1);
				jComb1.bind();
				
				if(!comps1.isEmpty()){
					Componente compAdd = comps1.get(0);
					if(compAdd.getEhUnicoPorPainel()){
						lstDep1.setSelectedItem(compAdd);
						botAddDep1.setEnabled(false);
					}
				}
				
				Componente valorAtual1 = componente.getDependenciaPortipo(tipoDependencia1);
				
				if(valorAtual1 != null){
				  lstDep1.setSelectedItem(valorAtual1);
				}

			} else if (componente.getDependencias().size() == 2) {
				painelDep3.setVisible(false);

				tipoDependencia1 = componente.getDependencias().get(0);
				tipoDependencia2 = componente.getDependencias().get(1);

				comps1 = painel.getComponentesPorTipo(tipoDependencia1);
				txtDep1.setText(tipoDependencia1);
				jComb1 = org.jdesktop.swingbinding.SwingBindings
						.createJComboBoxBinding(
								org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
								comps1, lstDep1);
				jComb1.bind();

				comps2 = painel.getComponentesPorTipo(tipoDependencia2);
				txtDep2.setText(tipoDependencia2);
				jComb2 = org.jdesktop.swingbinding.SwingBindings
						.createJComboBoxBinding(
								org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
								comps2, lstDep2);
				jComb2.bind();
				
				
				if(!comps1.isEmpty()){
					Componente compAdd = comps1.get(0);
					if(compAdd.getEhUnicoPorPainel()){
						lstDep1.setSelectedItem(compAdd);
						botAddDep1.setEnabled(false);
					}
				}
				if(!comps2.isEmpty()){
					Componente compAdd = comps2.get(0);
					if(compAdd.getEhUnicoPorPainel()){
						lstDep2.setSelectedItem(compAdd);
						botAddDep2.setEnabled(false);
					}
				}
				
				Componente valorAtual1 = componente.getDependenciaPortipo(tipoDependencia1);
				if(valorAtual1 != null){
				  lstDep1.setSelectedItem(valorAtual1);
				}
				Componente valorAtual2 = componente.getDependenciaPortipo(tipoDependencia2);
				if(valorAtual2 != null){
				  lstDep2.setSelectedItem(valorAtual2);
				}

			} else {

				tipoDependencia1 = componente.getDependencias().get(0);
				tipoDependencia2 = componente.getDependencias().get(1);
				tipoDependencia3 = componente.getDependencias().get(2);

				comps1 = painel.getComponentesPorTipo(tipoDependencia1);
				txtDep1.setText(tipoDependencia1);
				jComb1 = org.jdesktop.swingbinding.SwingBindings
						.createJComboBoxBinding(
								org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
								comps1, lstDep1);
				jComb1.bind();

				comps2 = painel.getComponentesPorTipo(tipoDependencia2);
				txtDep2.setText(tipoDependencia2);
				jComb2 = org.jdesktop.swingbinding.SwingBindings
						.createJComboBoxBinding(
								org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
								comps2, lstDep2);
				jComb2.bind();

				comps3 = painel.getComponentesPorTipo(tipoDependencia3);
				txtDep3.setText(tipoDependencia3);
				jComb3 = org.jdesktop.swingbinding.SwingBindings
						.createJComboBoxBinding(
								org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
								comps3, lstDep3);
				jComb3.bind();
				
				
				if(!comps1.isEmpty()){
					Componente compAdd = comps1.get(0);
					if(compAdd.getEhUnicoPorPainel()){
						lstDep1.setSelectedItem(compAdd);
						botAddDep1.setEnabled(false);
					}
				}
				if(!comps2.isEmpty()){
					Componente compAdd = comps2.get(0);
					if(compAdd.getEhUnicoPorPainel()){
						lstDep2.setSelectedItem(compAdd);
						botAddDep2.setEnabled(false);
					}
				}
				if(!comps3.isEmpty()){
					Componente compAdd = comps3.get(0);
					if(compAdd.getEhUnicoPorPainel()){
						lstDep3.setSelectedItem(compAdd);
						botAddDep3.setEnabled(false);
					}
				}
				
				Componente valorAtual1 = componente.getDependenciaPortipo(tipoDependencia1);
				if(valorAtual1 != null){
				  lstDep1.setSelectedItem(valorAtual1);
				}
				Componente valorAtual2 = componente.getDependenciaPortipo(tipoDependencia2);
				if(valorAtual2 != null){
				  lstDep2.setSelectedItem(valorAtual2);
				}
				Componente valorAtual3 = componente.getDependenciaPortipo(tipoDependencia3);
				if(valorAtual3 != null){
				  lstDep3.setSelectedItem(valorAtual3);
				}

			}

		}
		jButton4.requestFocus();

	}
	
	public void atualizaListaEPermissoes(List<Componente> listaEmAdicao){
		//System.out.println("atualizaListaEPermissoes");
		if(listaEmAdicao != null && !listaEmAdicao.isEmpty()){
			if(listaEmAdicao.equals(comps1)){
				
				Componente compAdd = listaEmAdicao.get(listaEmAdicao.size() -1);
				lstDep1.setSelectedItem(compAdd);
				if(compAdd.getEhUnicoPorPainel()){
					
					botAddDep1.setEnabled(false);
				}
			}
			if(listaEmAdicao.equals(comps2)){
				Componente compAdd = listaEmAdicao.get(listaEmAdicao.size() -1);
				lstDep2.setSelectedItem(compAdd);
				if(compAdd.getEhUnicoPorPainel()){
					
					botAddDep2.setEnabled(false);
				}
			}
			if(listaEmAdicao.equals(comps3)){
				Componente compAdd = listaEmAdicao.get(listaEmAdicao.size() -1);
				lstDep3.setSelectedItem(compAdd);
				if(compAdd.getEhUnicoPorPainel()){
					
					botAddDep3.setEnabled(false);
				}
			}
			
			
			
			
		}
		
		
	}

	
	@Action
	public void adicionarComponente(String tipoComponente,
			List<Componente> listaInclusao) {
		
		
		
		FrontEndSubApp.getApplication().show(
				new AdicaoComponenteMod("Adicao do componente tipo " + tipoComponente ,modSubEstacao, tipoComponente, painel,
						listaInclusao, this));
		
		

	}

	@Action
	public void adicionarComponenteDep1() {
		adicionarComponente(tipoDependencia1, comps1);
		
		
		
	}

	@Action
	public void adicionarComponenteDep2() {
		adicionarComponente(tipoDependencia2, comps2);
		
	}

	@Action
	public void adicionarComponenteDep3() {
		adicionarComponente(tipoDependencia3, comps3);
		
	}

	@Action
	public void confirmar() {
		
		List<Componente> destinos = new LinkedList<Componente>();
		
		if(componente.getDependencias().size() == 1){
			Componente compDep1 = (Componente) lstDep1.getSelectedItem();
			if(compDep1 == null){
				JOptionPane.showMessageDialog(this,
						"Informe a dependencia do tipo " + tipoDependencia1, "Erro",
						JOptionPane.ERROR_MESSAGE);
				return;
			}
			destinos.add(compDep1);
		}else if(componente.getDependencias().size() == 2){
			Componente compDep1 = (Componente) lstDep1.getSelectedItem();
			Componente compDep2 = (Componente) lstDep2.getSelectedItem();
			if(compDep1 == null){
				JOptionPane.showMessageDialog(this,
						"Informe a dependencia do tipo " + tipoDependencia1, "Erro",
						JOptionPane.ERROR_MESSAGE);
				return;
			}
			if(compDep2 == null){
				JOptionPane.showMessageDialog(this,
						"Informe a dependencia do tipo " + tipoDependencia2, "Erro",
						JOptionPane.ERROR_MESSAGE);
				return;
			}
			destinos.add(compDep1);
			destinos.add(compDep2);
			
		}else if (componente.getDependencias().size() == 3){
			Componente compDep1 = (Componente) lstDep1.getSelectedItem();
			Componente compDep2 = (Componente) lstDep2.getSelectedItem();
			Componente compDep3 = (Componente) lstDep3.getSelectedItem();
			if(compDep1 == null){
				JOptionPane.showMessageDialog(this,
						"Informe a dependencia do tipo " + tipoDependencia1, "Erro",
						JOptionPane.ERROR_MESSAGE);
				return;
			}
			if(compDep2 == null){
				JOptionPane.showMessageDialog(this,
						"Informe a dependencia do tipo " + tipoDependencia2, "Erro",
						JOptionPane.ERROR_MESSAGE);
				return;
			}
			if(compDep3 == null){
				JOptionPane.showMessageDialog(this,
						"Informe a dependencia do tipo " + tipoDependencia3, "Erro",
						JOptionPane.ERROR_MESSAGE);
				return;
			}
			destinos.add(compDep1);
			destinos.add(compDep2);
			destinos.add(compDep3);
			
		}
		
		this.modSubEstacao.criarLigacoes(painel, componente, destinos);
		this.modSubEstacao.criarDependencias(componente, destinos);
		
		this.setVisible(false);
	}

	@Action
	public void atualizaListas() {
		if (jComb1 != null) {
			this.jComb1.refresh();
			lstDep1.repaint();
			if(!comps1.isEmpty()){
				
				lstDep1.setSelectedItem(comps1.get(comps1.size() - 1));
			}
		}
		if (jComb2 != null) {
			this.jComb2.refresh();
			lstDep2.repaint();
			
			
		}
		if (jComb3 != null) {
			this.jComb3.refresh();
			lstDep3.repaint();
		}

	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
	// <editor-fold defaultstate="collapsed" desc="Generated
	// <editor-fold defaultstate="collapsed" desc="Generated
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        painelDep1 = new javax.swing.JPanel();
        txtDep1 = new javax.swing.JLabel();
        lstDep1 = new javax.swing.JComboBox();
        botAddDep1 = new javax.swing.JButton();
        painelDep2 = new javax.swing.JPanel();
        txtDep2 = new javax.swing.JLabel();
        lstDep2 = new javax.swing.JComboBox();
        botAddDep2 = new javax.swing.JButton();
        painelDep3 = new javax.swing.JPanel();
        txtDep3 = new javax.swing.JLabel();
        lstDep3 = new javax.swing.JComboBox();
        botAddDep3 = new javax.swing.JButton();
        labelInfo = new javax.swing.JLabel();
        jButton4 = new javax.swing.JButton();
        labelInfo2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(655, 150));
        setName("Form"); // NOI18N
        setResizable(false);

        jPanel1.setName("jPanel1"); // NOI18N

        painelDep1.setName("painelDep1"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(front.end.subestacao.ui.FrontEndSubApp.class).getContext().getResourceMap(AdicaoComponenteDep.class);
        txtDep1.setText(resourceMap.getString("txtDep1.text")); // NOI18N
        txtDep1.setName("txtDep1"); // NOI18N

        lstDep1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        lstDep1.setName("lstDep1"); // NOI18N
        lstDep1.setRequestFocusEnabled(false);

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(front.end.subestacao.ui.FrontEndSubApp.class).getContext().getActionMap(AdicaoComponenteDep.class, this);
        botAddDep1.setAction(actionMap.get("adicionarComponenteDep1")); // NOI18N
        botAddDep1.setIcon(resourceMap.getIcon("botAddDep1.icon")); // NOI18N
        botAddDep1.setText(resourceMap.getString("botAddDep1.text")); // NOI18N
        botAddDep1.setName("botAddDep1"); // NOI18N
        botAddDep1.setRequestFocusEnabled(false);

        javax.swing.GroupLayout painelDep1Layout = new javax.swing.GroupLayout(painelDep1);
        painelDep1.setLayout(painelDep1Layout);
        painelDep1Layout.setHorizontalGroup(
            painelDep1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelDep1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(txtDep1, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lstDep1, javax.swing.GroupLayout.PREFERRED_SIZE, 293, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30)
                .addComponent(botAddDep1)
                .addContainerGap())
        );
        painelDep1Layout.setVerticalGroup(
            painelDep1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelDep1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(painelDep1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botAddDep1)
                    .addComponent(txtDep1)
                    .addComponent(lstDep1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        painelDep2.setName("painelDep2"); // NOI18N

        txtDep2.setText(resourceMap.getString("txtDep2.text")); // NOI18N
        txtDep2.setName("txtDep2"); // NOI18N

        lstDep2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        lstDep2.setName("lstDep2"); // NOI18N
        lstDep2.setRequestFocusEnabled(false);

        botAddDep2.setAction(actionMap.get("adicionarComponenteDep2")); // NOI18N
        botAddDep2.setIcon(resourceMap.getIcon("botAddDep2.icon")); // NOI18N
        botAddDep2.setText(resourceMap.getString("botAddDep2.text")); // NOI18N
        botAddDep2.setName("botAddDep2"); // NOI18N
        botAddDep2.setRequestFocusEnabled(false);

        javax.swing.GroupLayout painelDep2Layout = new javax.swing.GroupLayout(painelDep2);
        painelDep2.setLayout(painelDep2Layout);
        painelDep2Layout.setHorizontalGroup(
            painelDep2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelDep2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(txtDep2, javax.swing.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lstDep2, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(31, 31, 31)
                .addComponent(botAddDep2)
                .addContainerGap())
        );
        painelDep2Layout.setVerticalGroup(
            painelDep2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelDep2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(painelDep2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtDep2)
                    .addComponent(botAddDep2)
                    .addComponent(lstDep2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        painelDep3.setName("painelDep3"); // NOI18N

        txtDep3.setText(resourceMap.getString("txtDep3.text")); // NOI18N
        txtDep3.setName("txtDep3"); // NOI18N

        lstDep3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        lstDep3.setName("lstDep3"); // NOI18N
        lstDep3.setRequestFocusEnabled(false);

        botAddDep3.setAction(actionMap.get("adicionarComponenteDep3")); // NOI18N
        botAddDep3.setIcon(resourceMap.getIcon("botAddDep3.icon")); // NOI18N
        botAddDep3.setText(resourceMap.getString("botAddDep3.text")); // NOI18N
        botAddDep3.setName("botAddDep3"); // NOI18N
        botAddDep3.setRequestFocusEnabled(false);

        javax.swing.GroupLayout painelDep3Layout = new javax.swing.GroupLayout(painelDep3);
        painelDep3.setLayout(painelDep3Layout);
        painelDep3Layout.setHorizontalGroup(
            painelDep3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelDep3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(txtDep3, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lstDep3, javax.swing.GroupLayout.PREFERRED_SIZE, 293, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(29, 29, 29)
                .addComponent(botAddDep3)
                .addContainerGap())
        );
        painelDep3Layout.setVerticalGroup(
            painelDep3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelDep3Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(painelDep3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtDep3)
                    .addComponent(botAddDep3)
                    .addComponent(lstDep3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(painelDep1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(painelDep2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(painelDep3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(painelDep1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(painelDep2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(painelDep3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        labelInfo.setFont(resourceMap.getFont("labelInfo.font")); // NOI18N
        labelInfo.setIcon(resourceMap.getIcon("labelInfo.icon")); // NOI18N
        labelInfo.setText(resourceMap.getString("labelInfo.text")); // NOI18N
        labelInfo.setName("labelInfo"); // NOI18N

        jButton4.setAction(actionMap.get("confirmar")); // NOI18N
        jButton4.setIcon(resourceMap.getIcon("jButton4.icon")); // NOI18N
        jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N
        jButton4.setName("jButton4"); // NOI18N
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        labelInfo2.setFont(resourceMap.getFont("labelInfo2.font")); // NOI18N
        labelInfo2.setText(resourceMap.getString("labelInfo2.text")); // NOI18N
        labelInfo2.setName("labelInfo2"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(labelInfo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(labelInfo2, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButton4)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelInfo)
                    .addComponent(labelInfo2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton4)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

	private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButton4ActionPerformed
		// TODO add your handling code here:
	}// GEN-LAST:event_jButton4ActionPerformed

	/**
	 * @param args
	 *            the command line arguments
	 */
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				// new AdicaoComponenteDep().setVisible(true);
			}
		});
	}

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botAddDep1;
    private javax.swing.JButton botAddDep2;
    private javax.swing.JButton botAddDep3;
    private javax.swing.JButton jButton4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel labelInfo;
    private javax.swing.JLabel labelInfo2;
    private javax.swing.JComboBox lstDep1;
    private javax.swing.JComboBox lstDep2;
    private javax.swing.JComboBox lstDep3;
    private javax.swing.JPanel painelDep1;
    private javax.swing.JPanel painelDep2;
    private javax.swing.JPanel painelDep3;
    private javax.swing.JLabel txtDep1;
    private javax.swing.JLabel txtDep2;
    private javax.swing.JLabel txtDep3;
    // End of variables declaration//GEN-END:variables

}
